package com.Service.advice;

import com.Service.pointcu.MyPintCut;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;

/**
 * @author Cheng-02
 * @version V1.0
 * @Package com.Service.advice
 * @date 2024/4/24 下午7:15
 */
@Component
@Aspect
public class TxAdvice {
    @Before("com.Service.pointcu.MyPintCut.pc()")
    public void begin(){
        System.out.println("start");
    }
    @AfterReturning("com.Service.pointcu.MyPintCut.pc()")
    public void commit(){
        System.out.println("submit");
    }
    @AfterReturning("com.Service.pointcu.MyPintCut.pc()")
    public  void rollback(){
        System.out.println("rollback");

    }
}
